<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">
    
    <ui:define name="head">
        <style type="text/css">
            .ui-toggleswitch {
                vertical-align: bottom;
            }
        </style>
     </ui:define>
    
    <ui:define name="title">
        ToggleSwitch
    </ui:define>

    <ui:define name="description">
        ToggleSwitch is used to select a boolean value.
    </ui:define>

    <ui:param name="documentationLink" value="/components/toggleswitch" />

    <ui:define name="implementation">

        <h:form>
            <p:growl id="msg" />

            <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
                <h:outputText value="Basic: " />
                <p:toggleSwitch value="#{selectBooleanView.value1}" />
                
                <h:outputText value="Ajax: " />
                <p:toggleSwitch value="#{selectBooleanView.value2}">
                    <p:ajax listener="#{selectBooleanView.addMessage}" update="msg" />
                </p:toggleSwitch>
            </h:panelGrid>

            <p:commandButton value="Submit" icon="pi pi-check" update="display" oncomplete="PF('dlg').show()" />

            <p:dialog header="Values" modal="true" resizable="false" showEffect="fade" widgetVar="dlg">
                <h:panelGrid columns="1" id="display">
                    <h:outputText value="Value 1: #{selectBooleanView.value1}" />
                    <h:outputText value="Value 2: #{selectBooleanView.value2}" />
                </h:panelGrid>
            </p:dialog>
        </h:form>
        
    </ui:define>

</ui:composition>